/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dchapman
 */
@Entity
@Table(name = "SpclPrice")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SpclPrice.findAll", query = "SELECT s FROM SpclPrice s"),
    @NamedQuery(name = "SpclPrice.findBySpid", query = "SELECT s FROM SpclPrice s WHERE s.spid = :spid"),
    @NamedQuery(name = "SpclPrice.findByCustID", query = "SELECT s FROM SpclPrice s WHERE s.custID = :custID"),
    @NamedQuery(name = "SpclPrice.findByPrice", query = "SELECT s FROM SpclPrice s WHERE s.price = :price")})
public class SpclPrice implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "spid")
    private Integer spid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "custID")
    private int custID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "price")
    private float price;

    public SpclPrice() {
    }

    public SpclPrice(Integer spid) {
        this.spid = spid;
    }

    public SpclPrice(Integer spid, int custID, float price) {
        this.spid = spid;
        this.custID = custID;
        this.price = price;
    }

    public Integer getSpid() {
        return spid;
    }

    public void setSpid(Integer spid) {
        this.spid = spid;
    }

    public int getCustID() {
        return custID;
    }

    public void setCustID(int custID) {
        this.custID = custID;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (spid != null ? spid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SpclPrice)) {
            return false;
        }
        SpclPrice other = (SpclPrice) object;
        if ((this.spid == null && other.spid != null) || (this.spid != null && !this.spid.equals(other.spid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.SpclPrice[ spid=" + spid + " ]";
    }
    
}
